﻿using ETModel;
using ETHotfix;
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

namespace DemoPathfinding.Hotfix.Entitys {

    [ObjectSystem]
    public class DemoUnitAwakeSystem : AwakeSystem<GameUnit, long> {
        public override void Awake(GameUnit self, long playerId) {
            self.Awake(playerId);
        }
    }

    public class GameUnit : Unit {
        public Vector3 Position;

        public UnitInfo BuildUnitInfo() {
            return new UnitInfo {
                UnitId = Id,
                PlayerId = PlayerId,
                PosX = Position.x,
                PosY = Position.y,
                PosZ = Position.z,
            };
        }

        public override float GetMoveSpeed() {
            return 5;
        }

        public override Vector3 GetPosition() {
            return Position;
        }

        public override void SetPosition(Vector3 pos) {
            Position = pos;
        }
    }
}
